#ifndef HEADER_ITERATOR
#define HEADER_ITERATOR

#ifndef HEADER_LISTECHAINEE
struct noeud
{
    void * value;
    struct noeud* suivant;
};
 #endif

class Iterator
{
public :
    Iterator(){
        this->debut = NULL;
    }

    Iterator(struct noeud* debut)
    {
        this->debut = debut;
    }

    void* next()
    {
        if(debut == NULL)
            return NULL;
        void * retour = debut->value;
        debut = debut->suivant;
        return retour;
    }

    bool hasNext()
    {
        return debut != NULL;
    }

    void setDebut(struct noeud* debut){
        this->debut = debut;
    }
private :
    struct noeud* debut;
};

#endif
